#include<cstdio>
int whichday(int m,int d);
int main()
{
	int a,b;
	printf("Please enter the date(mm dd).\n");
	scanf("%d%d",&a,&b);
	printf("It's the %dth day in this year.\n",whichday(a,b));
	return 0;
}
int whichday(int m,int d)
{
	int count=0;
	switch(m)
	{
		case 12:
		case 11:
			count++;
		case 10:
		case 9:
			count++;
		case 8:
			count++;
		case 7:
		case 6:
			count++;
		case 5:
		case 4:
			count++;
		case 3:
			count--;
		case 2:
			count++;
		case 1:
			break;
	}
	count+=(m-1)*30;
	count+=d;
	return count;
}
